package  gearunits.models{
	import sandy.primitive.Primitive3D;
	import sandy.core.scenegraph.Geometry3D;
	import sandy.core.scenegraph.Shape3D;

	public class SMeshStoreshop extends Shape3D implements Primitive3D {
		private var l:Geometry3D;

		private function f(v1:Number,v2:Number,v3:Number,uv00:Number,uv01:Number,uv10:Number,uv11:Number,uv20:Number,uv21:Number,normX:Number,normY:Number,normZ:Number):void {
			var uv1:Number = l.getNextUVCoordID();
			var uv2:Number = uv1 + 1;
			var uv3:Number = uv2 + 1;

			l.setUVCoords(uv1,uv00,1-uv01);
			l.setUVCoords(uv2,uv10,1-uv11);
			l.setUVCoords(uv3,uv20,1-uv21);

			l.setFaceVertexIds(l.getNextFaceID(), v1,v2,v3);
			l.setFaceUVCoordsIds(l.getNextFaceUVCoordID(), uv1,uv2,uv3);
			l.setFaceNormal(l.getNextFaceNormalID(), normX,normZ,normY);
		}

		private function f4(v1:Number,v2:Number,v3:Number,v4:Number,uv00:Number,uv01:Number,uv10:Number,uv11:Number,uv20:Number,uv21:Number,uv30:Number,uv31:Number,normX:Number,normY:Number,normZ:Number):void {
			var uv1:Number = l.getNextUVCoordID();
			var uv2:Number = uv1 + 1;
			var uv3:Number = uv2 + 1;
			var uv4:Number = uv3 + 1;

			l.setUVCoords(uv1,uv00,1-uv01);
			l.setUVCoords(uv2,uv10,1-uv11);
			l.setUVCoords(uv3,uv20,1-uv21);
			l.setUVCoords(uv4,uv30,1-uv31);

			l.setFaceVertexIds(l.getNextFaceID(),v1,v2,v3,v4);
			l.setFaceUVCoordsIds(l.getNextFaceUVCoordID(),uv1,uv2,uv3,uv4);
			l.setFaceNormal(l.getNextFaceNormalID(),normX,normZ,normY);
		}

		private function f2(v1:Number,v2:Number,v3:Number):void {
			l.setFaceVertexIds(l.getNextFaceID(), v1,v2,v3);
		}

		private function v(vx:Number,vy:Number,vz:Number):void {
			l.setVertex(l.getNextVertexID(),vx,vz,vy);
		}

		public function SMeshStoreshop( p_Name:String=null ) {
			super( p_Name );
			geometry = generate();
		}

		public function generate(... arguments):Geometry3D {
			l = new Geometry3D();
			v(320.000000,320.000000,-1.000000);
			v(320.000000,-320.000000,-1.000000);
			v(-320.000031,-319.999939,-1.000000);
			v(-319.999878,320.000122,-1.000000);
			v(320.000122,319.999878,1.000000);
			v(319.999817,-320.000183,1.000000);
			v(-320.000122,-319.999878,1.000000);
			v(-319.999969,320.000000,1.000000);
			v(-319.999969,320.000000,321.000000);
			v(-320.000122,-319.999878,321.000000);
			v(319.999817,-320.000183,321.000000);
			v(320.000122,319.999878,321.000000);
			v(-319.999878,320.000122,319.000000);
			v(-320.000031,-319.999939,319.000000);
			v(320.000000,-320.000000,319.000000);
			v(320.000000,320.000000,319.000000);
			v(320.000000,-318.999969,320.000000);
			v(320.000000,-319.000031,0.000000);
			v(-320.000031,-319.000031,0.000031);
			v(-319.999878,-318.999969,320.000061);
			v(320.000122,-320.999969,319.999939);
			v(319.999817,-321.000031,-0.000092);
			v(-320.000122,-321.000031,0.000061);
			v(-319.999969,-320.999969,320.000000);
			v(-321.000000,319.999908,320.000000);
			v(-321.000061,320.000092,0.000061);
			v(-321.000000,-319.999847,-0.000092);
			v(-320.999939,-320.000153,319.999939);
			v(-319.000000,319.999847,320.000061);
			v(-319.000061,319.999969,0.000031);
			v(-319.000000,-320.000031,0.000000);
			v(-318.999939,-320.000031,320.000000);
			v(-320.000061,318.999908,320.000000);
			v(-320.000061,318.999969,0.000000);
			v(319.999939,319.000092,0.000031);
			v(319.999817,319.000031,320.000061);
			v(-320.000183,320.999908,319.999939);
			v(-319.999878,320.999969,-0.000092);
			v(320.000061,321.000092,0.000061);
			v(319.999878,321.000031,320.000000);
			v(321.000061,-319.999847,320.000000);
			v(321.000122,-320.000031,0.000061);
			v(320.999939,319.999908,-0.000092);
			v(320.999878,320.000214,319.999939);
			v(319.000061,-319.999786,320.000061);
			v(319.000122,-319.999908,0.000031);
			v(318.999939,320.000092,0.000000);
			v(318.999878,320.000092,320.000000);
			v(32.000000,31.999998,8.000000);
			v(32.000000,-32.000000,8.000000);
			v(-32.000004,-31.999994,8.000000);
			v(-31.999989,32.000011,8.000000);
			v(32.000015,31.999983,72.000000);
			v(31.999979,-32.000019,72.000000);
			v(-32.000011,-31.999989,72.000000);
			v(-31.999998,32.000000,72.000000);

			f(51,55,52,0.000000,0.334353,0.332314,0.333333,0.333333,0.665647,0.000000,1.000000,0.000000);
			f(51,52,48,0.000000,0.334353,0.333333,0.665647,0.001020,0.666667,0.000000,1.000000,0.000000);
			f(50,54,55,0.000000,0.332314,0.001020,0.000000,0.333333,0.001019,-1.000000,0.000000,-0.000000);
			f(50,55,51,0.000000,0.332314,0.333333,0.001019,0.332314,0.333333,-1.000000,0.000000,-0.000000);
			f(49,53,50,0.998981,0.000000,1.000000,0.332314,0.666667,0.001020,-0.000000,-1.000000,-0.000000);
			f(53,54,50,1.000000,0.332314,0.667686,0.333333,0.666667,0.001020,-0.000000,-1.000000,0.000000);
			f(48,52,49,0.665647,0.000000,0.666667,0.332314,0.333333,0.001020,1.000000,0.000000,-0.000000);
			f(52,53,49,0.666667,0.332314,0.334353,0.333333,0.333333,0.001020,1.000000,-0.000001,0.000000);
			f(52,55,53,1.000000,0.334353,0.998981,0.666667,0.667686,0.333333,-0.000000,-0.000000,1.000000);
			f(55,54,53,0.998981,0.666667,0.666667,0.665647,0.667686,0.333333,0.000000,-0.000000,1.000000);
			f(50,51,48,0.665647,0.333333,0.666667,0.665647,0.334353,0.666667,-0.000000,0.000000,-1.000000);
			f(50,48,49,0.665647,0.333333,0.334353,0.666667,0.333333,0.334353,-0.000000,0.000000,-1.000000);
			f(47,46,44,0.001529,0.500000,0.000000,0.001529,0.500000,0.498471,-1.000000,-0.000000,-0.000000);
			f(46,45,44,0.000000,0.001529,0.498471,0.000000,0.500000,0.498471,-1.000000,-0.000000,-0.000000);
			f(43,40,42,0.001529,0.500000,0.500000,0.501529,0.000000,0.998471,1.000000,0.000000,0.000000);
			f(40,41,42,0.500000,0.501529,0.498471,1.000000,0.000000,0.998471,1.000000,0.000000,0.000000);
			f(47,43,46,0.501529,0.000000,0.503087,0.000005,0.500000,0.498471,-0.000061,1.000000,-0.000000);
			f(43,42,46,0.503087,0.000005,0.501558,0.498476,0.500000,0.498471,0.000092,1.000000,-0.000001);
			f(46,42,45,0.506174,0.000005,0.507732,0.000000,0.507703,0.498476,-0.000046,-0.000000,-1.000000);
			f(42,41,45,0.507732,0.000000,0.509261,0.498471,0.507703,0.498476,0.000015,-0.000000,-1.000000);
			f(45,41,40,0.503087,0.000005,0.504645,0.000000,0.506174,0.498471,-0.000061,-1.000000,0.000001);
			f(45,40,44,0.503087,0.000005,0.506174,0.498471,0.504616,0.498476,-0.000031,-1.000000,0.000000);
			f(43,47,40,0.512348,0.498471,0.510790,0.498476,0.510819,0.000000,0.000031,0.000000,1.000000);
			f(47,44,40,0.510790,0.498476,0.509261,0.000005,0.510819,0.000000,0.000031,0.000000,1.000000);
			f(36,32,39,0.512348,0.498471,0.510790,0.498476,0.510819,0.000000,-0.000000,0.000031,1.000000);
			f(32,35,39,0.510790,0.498476,0.509261,0.000005,0.510819,0.000000,-0.000000,0.000031,1.000000);
			f(34,38,39,0.503087,0.000005,0.504645,0.000000,0.506174,0.498471,1.000000,-0.000061,0.000001);
			f(34,39,35,0.503087,0.000005,0.506174,0.498471,0.504616,0.498476,1.000000,-0.000031,0.000000);
			f(33,37,34,0.506174,0.000005,0.507732,0.000000,0.507703,0.498476,0.000000,-0.000046,-1.000000);
			f(37,38,34,0.507732,0.000000,0.509261,0.498471,0.507703,0.498476,0.000000,0.000015,-1.000000);
			f(32,36,33,0.501529,0.000000,0.503087,0.000005,0.500000,0.498471,-1.000000,-0.000061,-0.000000);
			f(36,37,33,0.503087,0.000005,0.501558,0.498476,0.500000,0.498471,-1.000000,0.000092,-0.000001);
			f(36,39,37,0.001529,0.500000,0.500000,0.501529,0.000000,0.998471,-0.000000,1.000000,0.000000);
			f(39,38,37,0.500000,0.501529,0.498471,1.000000,0.000000,0.998471,-0.000000,1.000000,0.000000);
			f(32,33,35,0.001529,0.500000,0.000000,0.001529,0.500000,0.498471,0.000000,-1.000000,-0.000000);
			f(33,34,35,0.000000,0.001529,0.498471,0.000000,0.500000,0.498471,0.000000,-1.000000,-0.000000);
			f(31,30,28,0.001529,0.500000,0.000000,0.001529,0.500000,0.498471,1.000000,0.000000,-0.000000);
			f(30,29,28,0.000000,0.001529,0.498471,0.000000,0.500000,0.498471,1.000000,0.000000,-0.000000);
			f(27,24,26,0.001529,0.500000,0.500000,0.501529,0.000000,0.998471,-1.000000,-0.000000,0.000000);
			f(24,25,26,0.500000,0.501529,0.498471,1.000000,0.000000,0.998471,-1.000000,-0.000000,0.000000);
			f(31,27,30,0.501529,0.000000,0.503087,0.000005,0.500000,0.498471,0.000061,-1.000000,-0.000000);
			f(27,26,30,0.503087,0.000005,0.501558,0.498476,0.500000,0.498471,-0.000092,-1.000000,-0.000001);
			f(30,26,29,0.506174,0.000005,0.507732,0.000000,0.507703,0.498476,0.000046,0.000000,-1.000000);
			f(26,25,29,0.507732,0.000000,0.509261,0.498471,0.507703,0.498476,-0.000015,0.000000,-1.000000);
			f(29,25,24,0.503087,0.000005,0.504645,0.000000,0.506174,0.498471,0.000061,1.000000,0.000001);
			f(29,24,28,0.503087,0.000005,0.506174,0.498471,0.504616,0.498476,0.000031,1.000000,0.000000);
			f(27,31,24,0.512348,0.498471,0.510790,0.498476,0.510819,0.000000,-0.000031,-0.000000,1.000000);
			f(31,28,24,0.510790,0.498476,0.509261,0.000005,0.510819,0.000000,-0.000031,-0.000000,1.000000);
			f(20,16,19,0.512348,0.498471,0.510790,0.498476,0.509261,0.000005,0.000000,-0.000031,1.000000);
			f(20,19,23,0.512348,0.498471,0.509261,0.000005,0.510819,0.000000,0.000000,-0.000031,1.000000);
			f(18,22,23,0.503087,0.000005,0.504645,0.000000,0.506174,0.498471,-1.000000,0.000046,0.000000);
			f(18,23,19,0.503087,0.000005,0.506174,0.498471,0.504616,0.498476,-1.000000,0.000046,0.000000);
			f(17,21,18,0.506174,0.000005,0.507732,0.000000,0.507703,0.498476,-0.000000,0.000046,-1.000000);
			f(21,22,18,0.507732,0.000000,0.509261,0.498471,0.507703,0.498476,-0.000000,-0.000015,-1.000000);
			f(16,20,17,0.501529,0.000000,0.503087,0.000005,0.500000,0.498471,1.000000,0.000061,-0.000000);
			f(20,21,17,0.503087,0.000005,0.501558,0.498476,0.500000,0.498471,1.000000,-0.000092,-0.000001);
			f(20,23,21,0.001529,0.500000,0.500000,0.501529,0.000000,0.998471,0.000000,-1.000000,0.000000);
			f(23,22,21,0.500000,0.501529,0.498471,1.000000,0.000000,0.998471,0.000000,-1.000000,0.000000);
			f(16,17,19,0.001529,0.500000,0.000000,0.001529,0.500000,0.498471,-0.000000,1.000000,-0.000000);
			f(17,18,19,0.000000,0.001529,0.498471,0.000000,0.500000,0.498471,-0.000000,1.000000,-0.000000);
			f(15,14,13,0.001529,0.500000,0.000000,0.001529,0.498471,0.000000,0.000000,0.000000,-1.000000);
			f(15,13,12,0.001529,0.500000,0.498471,0.000000,0.500000,0.498471,0.000000,-0.000000,-1.000000);
			f(11,8,10,0.001529,0.500000,0.500000,0.501529,0.000000,0.998471,-0.000000,-0.000000,1.000000);
			f(8,9,10,0.500000,0.501529,0.498471,1.000000,0.000000,0.998471,0.000000,-0.000000,1.000000);
			f(15,11,14,0.501529,0.000000,0.503087,0.000005,0.500000,0.498471,1.000000,0.000000,-0.000061);
			f(11,10,14,0.503087,0.000005,0.501558,0.498476,0.500000,0.498471,1.000000,-0.000000,0.000092);
			f(14,10,13,0.506174,0.000005,0.507732,0.000000,0.507703,0.498476,-0.000000,-1.000000,-0.000092);
			f(10,9,13,0.507732,0.000000,0.509261,0.498471,0.507703,0.498476,-0.000000,-1.000000,0.000031);
			f(13,9,8,0.503087,0.000005,0.504645,0.000000,0.506174,0.498471,-1.000000,0.000000,-0.000046);
			f(13,8,12,0.503087,0.000005,0.506174,0.498471,0.504616,0.498476,-1.000000,0.000000,-0.000046);
			f(11,15,12,0.512348,0.498471,0.510790,0.498476,0.509261,0.000005,0.000000,1.000000,0.000061);
			f(11,12,8,0.512348,0.498471,0.509261,0.000005,0.510819,0.000000,0.000000,1.000000,0.000061);
			f(4,0,3,0.512348,0.498471,0.510790,0.498476,0.509261,0.000005,0.000000,1.000000,0.000061);
			f(4,3,7,0.512348,0.498471,0.509261,0.000005,0.510819,0.000000,0.000000,1.000000,0.000061);
			f(2,6,7,0.503087,0.000005,0.504645,0.000000,0.506174,0.498471,-1.000000,0.000000,-0.000046);
			f(2,7,3,0.503087,0.000005,0.506174,0.498471,0.504616,0.498476,-1.000000,0.000000,-0.000046);
			f(1,5,2,0.506174,0.000005,0.507732,0.000000,0.507703,0.498476,-0.000000,-1.000000,-0.000092);
			f(5,6,2,0.507732,0.000000,0.509261,0.498471,0.507703,0.498476,-0.000000,-1.000000,0.000031);
			f(0,4,1,0.501529,0.000000,0.503087,0.000005,0.500000,0.498471,1.000000,0.000000,-0.000061);
			f(4,5,1,0.503087,0.000005,0.501558,0.498476,0.500000,0.498471,1.000000,-0.000000,0.000092);
			f(4,7,5,0.001529,0.500000,0.500000,0.501529,0.000000,0.998471,-0.000000,-0.000000,1.000000);
			f(7,6,5,0.500000,0.501529,0.498471,1.000000,0.000000,0.998471,0.000000,-0.000000,1.000000);
			f(0,1,2,0.001529,0.500000,0.000000,0.001529,0.498471,0.000000,0.000000,0.000000,-1.000000);
			f(0,2,3,0.001529,0.500000,0.498471,0.000000,0.500000,0.498471,0.000000,-0.000000,-1.000000);

			this.x = 0.000000;
			this.y = 0.000000;
			this.z = 0.000000;

			this.rotateX = 0.000000;
			this.rotateY = 0.000000;
			this.rotateZ = 0.000000;

			this.scaleX = 1.000000;
			this.scaleY = 1.000000;
			this.scaleZ = 1.000000;
			return (l);
		}
	}
}